package com.mmg.cosplay.utils;

public class RoleContext {

    //创建一个当前线程的对象
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //设置值
    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    //获取值
    public static Long getCurrentId() {
        return threadLocal.get();
    }

    //删除值
    public static void removeCurrentId() {
        threadLocal.remove();
    }
}
